package com.emo.cloudEdge.controller;

import com.emo.cloudEdge.service.UserAndSippliersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@RestController
public class UserAndSippliersController {
    @Autowired
    private UserAndSippliersService userAndSippliersService;
    /**
     * 注册 - 只注册供应商
     * @param request
     * @param response
     * @throws IOException
     */
    @RequestMapping("/register")
    private void register(HttpServletRequest request, HttpServletResponse response) throws IOException{
        String registerData=request.getParameter("registerData");
        response.getWriter().write(userAndSippliersService.insertAll(registerData));
    }
}
